package models

import "time"

type LogSupplement struct {
	ID           int64     `gorm:"column:id" json:"id"`
	MemberId     int64     `gorm:"column:member_id" json:"member_id"`
	SocialType   int64     `gorm:"column:social_type" json:"social_type"`
	AccountId    int64     `gorm:"column:account_id" json:"account_id"`
	CoinCount    int64     `gorm:"column:coin_count" json:"coin_count"`
	CreateTime   time.Time `gorm:"column:create_time" json:"create_time"`
	Integral     int64     `gorm:"column:integral" json:"integral"`
	OldCoinCount int64     `gorm:"column:old_coin_count" json:"old_coin_count"`
	Remarks      string    `gorm:"column:remarks" json:"remarks"`
	OldIntegral  int64     `gorm:"column:old_integral" json:"old_integral"`
}

func (this *LogSupplement) GetList(
	where map[string]interface{},
	pagination map[string]interface{},
) (
	Logs []LogSupplement,
	count int,
) {
	db := Db
	db = ParsePagination(db, pagination)
	db = ParseWhere(db, where)
	db.Find(&Logs).Count(&count)
	return
}
